#ifndef dq_Property_h
#define dq_Property_h

#include "Record.h"
#include <utility/String.h>

namespace serika
{
	namespace db
	{
		class ItemProperty;
		class PropertyTemplate;
	}

	namespace dq
	{
		class PropertyTemplate;

		class Property
		{
			typedef Record<db::ItemProperty> ItemProperty;

			Property(db::ItemProperty* itemProperty, TransientState::Enum state);
		public:
			~Property();

			static Property* NewProperty(int itemId, int reserved1, int reserved2, int reserved3, const ut::String& reserved4, 
				PropertyTemplate* propertyTemplate);
			static Property* FromDb(db::ItemProperty* dbProperty);

		public:
			int GetId() const;
			int GetTemplateId() const;
			int GetItemId() const;
			int GetReserved1() const;
			int GetReserved2() const;
			int GetReserved3() const;
			const ut::String& GetReserved4() const;
			const ut::String& GetDescription() const;

			void SetItemId(int itemId);
			void SetReserved1(int reserved1);
			void SetReserved2(int reserved2);
			void SetReserved3(int reserved3);
			void SetReserved4(const ut::String& reserved4);

			void Save();
			void Delete();

		private:
			ItemProperty* mProperty;
		};
	}
}

#endif
